package Thread;

public class Demo11 {
    public static void main(String[] args) {
        Thread t=new Thread(()->{
            while (true){

            }
        });
        //在调用start方法之前，获取状态，此时就是new
        System.out.println(t.getState());
        t.start();
        try {
            t.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        //在线程执行结束之后，获取状态，此时就是terminated状态
        System.out.println(t.getState());

    }
}
